/*
* @author dumeng
*/
'use strict'
import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: { dictCode }
  })
}

/**
 * 查询红包活动列表
 * @param data
 * @returns {*}
 */
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivity/queryPage',
    method: 'post',
    data
  })
}

/**
 * 获取出金账户
 * @param {*} data
 * @returns
 */
export function getAcc(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/account/getExpenditureAccount',
    method: 'post',
    data
  })
}
/**
 * 获取用户子账号数据
 * @param {*} data
 * @returns
 */
export function getAccountList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/childAccount/query',
    method: 'post',
    data
  })
}
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivity/get',
    method: 'post',
    data
  })
}

export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivity/insert',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivity/update',
    method: 'post',
    data
  })
}

export function updateState(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: 'backend/redpacketsActivity/publish',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivity/deleteById',
    method: 'post',
    data
  })
}

/**
 * 领取记录信息
 * @param data
 * @returns {*}
 */
export function queryRecord(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivityRecord/queryPage',
    method: 'post',
    data
  })
}
/**
 * 领取记录统计信息
 * @param data
 * @returns {*}
 */
export function queryStatistics(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/redpacketsActivityRecord/activityRecordTotal',
    method: 'post',
    data
  })
}
